home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / LayoutManager2.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  78 lines

  1. /*
  2.  * @(#)LayoutManager2.java    1.6 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.awt;
  15.  
  16. /** 
  17.  * Defines an interface for classes that know how to layout Containers
  18.  * based on a layout constraints object.
  19.  *
  20.  * This interface extends the LayoutManager interface to deal with layouts
  21.  * explicitly in terms of constraint objects that specify how and where
  22.  * components should be added to the layout.
  23.  * <p>
  24.  * This minimal extension to LayoutManager is intended for tool
  25.  * providers who wish to the creation of constraint-based layouts.
  26.  * It does not yet provide full, general support for custom
  27.  * constraint-based layout managers.
  28.  *
  29.  * @see LayoutManager
  30.  * @see Container
  31.  *
  32.  * @version    1.6, 07/01/98
  33.  * @author     Jonni Kanerva
  34.  */
  35. public interface LayoutManager2 extends LayoutManager {
  36.  
  37.     /**
  38.      * Adds the specified component to the layout, using the specified
  39.      * constraint object.
  40.      * @param comp the component to be added
  41.      * @param constraints  where/how the component is added to the layout.
  42.      */
  43.     void addLayoutComponent(Component comp, Object constraints);
  44.  
  45.     /** 
  46.      * Returns the maximum size of this component.
  47.      * @see java.awt.Component#getMinimumSize()
  48.      * @see java.awt.Component#getPreferredSize()
  49.      * @see LayoutManager
  50.      */
  51.     public Dimension maximumLayoutSize(Container target);
  52.  
  53.     /**
  54.      * Returns the alignment along the x axis.  This specifies how
  55.      * the component would like to be aligned relative to other 
  56.      * components.  The value should be a number between 0 and 1
  57.      * where 0 represents alignment along the origin, 1 is aligned
  58.      * the furthest away from the origin, 0.5 is centered, etc.
  59.      */
  60.     public float getLayoutAlignmentX(Container target);
  61.  
  62.     /**
  63.      * Returns the alignment along the y axis.  This specifies how
  64.      * the component would like to be aligned relative to other 
  65.      * components.  The value should be a number between 0 and 1
  66.      * where 0 represents alignment along the origin, 1 is aligned
  67.      * the furthest away from the origin, 0.5 is centered, etc.
  68.      */
  69.     public float getLayoutAlignmentY(Container target);
  70.  
  71.     /**
  72.      * Invalidates the layout, indicating that if the layout manager
  73.      * has cached information it should be discarded.
  74.      */
  75.     public void invalidateLayout(Container target);
  76.  
  77. }
  78.